package com.example.androidlove;

import android.support.v7.app.ActionBarActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends Activity implements OnClickListener{

	// Variable -- Chanh Thi
	// Chanh Thi -- Add new Edit text , button
	/*EditText userName;
	EditText passWord;
	Button buttonLogin;
	Button buttonCancel;*/
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        // Chanh Thi-- Create edit Text and button
        /*userName = (EditText)findViewById(R.id.userName);
        passWord = (EditText)findViewById(R.id.password);
        buttonLogin = (Button)findViewById(R.id.login);
        buttonCancel = (Button)findViewById(R.id.buttonCancel);*/
        //buttonLogin.setOnClickListener(this);
        //buttonCancel.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
		//Chanh Thi---Get string name & pass from Edit Text
		//String name = userName.getText().toString();
		//String pass = passWord.getText().toString();
		
		//Chanh Thi--- Check when click button
		/*switch (v.getId()) {
		case R.id.login:
			
			//Chanh Thi-- if username and password are right => Move to main screen
			if(name.equals("chanhthi")&& pass.equals("123")){
				//Intent i= new Intent(this,MainScreenActivity.class);
				//startActivity(i);
			}
			break;
		
		case R.id.buttonCancel:
			//Chanh Thi-- if click cancel Username && Password are blank
			userName.setText(" ");
			passWord.setText(" ");
		default:
			break;
		}*/
		
	}
}
